//任务类型store
var typeStore = Ext.create('Ext.data.Store', {
    fields: [
        {name: 'typeNum', type: 'int'},
        {name: 'typeName', type: 'string'}
    ],
    proxy: {
        type: 'ajax',
        url: zuulUrl + '/' + taskServiceName + '/allTaskType',//请求
        reader: {
            type: 'json'
        }
    },
    sortable: true,//开启排序
    sorters: [{property: "typeNum", direction: "ASC"}], //根据TASK_TYPE_NUM来升序
    autoLoad: true//创建后自动调用此存储的加载方法，不加不会去请求
});

//任务优先级store
var priorityStore = Ext.create('Ext.data.Store', {
    fields: [
        {name: 'priorityNum', type: 'int'},
        {name: 'priorityName', type: 'string'}
    ],
    proxy: {
        type: 'ajax',
        url: zuulUrl + '/' + taskServiceName + '/allTaskPriority',//请求
        reader: {
            type: 'json'
        }
    },
    sortable: true,//开启排序
    sorters: [{property: "priorityNum", direction: "ASC"}], //根据TASK_TYPE_NUM来升序
    autoLoad: true//创建后自动调用此存储的加载方法，不加不会去请求
});

//任务状态store
var statusStoreForResponsible = Ext.create('Ext.data.Store', {
    fields: [
        {name: 'statusNum', type: 'int'},
        {name: 'statusName', type: 'string'}
    ],
    proxy: {
        type: 'ajax',
        url: zuulUrl + '/' + taskServiceName + '/allTaskStatus',//请求
        reader: {
            type: 'json'
        },
        extractResponseData: function (response) {
            var data = response.responseJson;
            data.push({
                statusNum: -2,
                statusName: '无条件'
            });
            return data;
        }
    },
    sortable: true,//开启排序
    sorters: [{property: "statusNum", direction: "ASC"}], //根据STATUS_NUM来降序
    autoLoad: true//创建后自动调用此存储的加载方法，不加不会去请求
});

//任务状态store
var statusStoreforReceiver = Ext.create('Ext.data.Store', {
    fields: [
        {name: 'statusNum', type: 'int'},
        {name: 'statusName', type: 'string'}
    ],
    proxy: {
        type: 'ajax',
        url: zuulUrl + '/' + taskServiceName + '/allTaskStatus',//请求
        reader: {
            type: 'json'
        },
        extractResponseData: function (response) {
            var data = response.responseJson;
            for(var i=0,length=data.length;i<length;i++){
                if(data[i].statusNum==-1||data[i].statusNum==0){
                    data.splice(i, 1);
                    i--;
                    length--;
                }
            }
            data.push({
                statusNum: -2,
                statusName: '无条件'
            });
            return data;
        }
    },
    sortable: true,//开启排序
    sorters: [{property: "statusNum", direction: "ASC"}], //根据STATUS_NUM来降序
    autoLoad: true//创建后自动调用此存储的加载方法，不加不会去请求
});

//任务附件列表store
var attachedStore = Ext.create('Ext.data.Store', {
    fields: [
        {name: 'id', type: 'string'},
        {name: 'uuid', type: 'string'},
        {name: 'attachedName', type: 'string'},
        {name: 'fileType', type: 'int'}
    ]
});